import http from "./request.ts"
import qs from 'qs'
// home/newProduct/list 分页查询首页新品
export const homeNewProductList = (params: MyHomeBrandListParams): RES<MyHomeBrandListModel> => http.get("/home/newProduct/list", { params })
// home/newProduct/create 添加首页新品

export const homeNewProductCreate = (params: MyHomeNewParams[]): RES<HomeBrandUpdateRecommendStatusModel> => http.post("/home/newProduct/create", params)
// /home/newProduct/delete 批量删除首页新品
export const homeNewProductDelete = (params: { ids: string | number }

): RES<MyHomeBrandListModel> => http.post(`/home/newProduct/delete`, qs.stringify(params))

// home/newProduct/update/recommendStatus 批量修改首页新品状态
export const homeNewProductUpdateRecommendStatus = (params: {
    recommendStatus: number;
    ids: any
}): RES<HomeBrandUpdateRecommendStatusParams> => {
    return http.post(`/home/newProduct/update/recommendStatus`, qs.stringify(params))
}
// home/newProduct/update/sort/{id} 修改首页新品排序
export const homeNewProductSortByID = (params: { id: string | number, sort: string }

): RES<MyHomeBrandListModel> => http.post(`/home/newProduct/update/sort/${params.id}?sort=${params.sort}&id=${params.id}`)

